<?//获取第一张图片作为尺寸标准
include_once("first_detail.php"); ?>



<li class="layui-form-item icon" >
    <label class="layui-form-label">ICON：</label>

    <div class="layui-input-block">
        <div class="layui-upload">
            <button type="button" class="layui-btn" id="test1">上传图片</button>
            <div class="layui-upload-list">
                <img class="layui-upload-img" id="icon" style="width: 95px;height: 95px;">
                <p id="iconText"></p>
            </div>
            <div style="width: 95px;">
                <div class="layui-progress layui-progress-big" lay-showpercent="yes" lay-filter="demo">
                    <div class="layui-progress-bar" lay-percent=""></div>
                </div>
            </div>
        </div> <a name="list-progress"> </a>

    </div>

    <em class="explain">此处图片多用于列表或者缩略图表示，请控制大小，建议大大于80k</em>
</li>


<style>
    .image_upload_item{ float: left;margin-right: 20px}
</style>








<li class="layui-form-item icon" >
    <label class="layui-form-label">产品相册：</label>

    <div class="layui-input-block">

        <div class="image_upload_item">
            <div class="layui-upload">
                <button type="button" class="layui-btn" id="image01">上传图片 1</button>
                <div class="layui-upload-list">
                    <img class="layui-upload-img" id="image01" style="width: 105px;height: 105px;">
                    <p id="iconText"></p>
                </div>
                <div style="width: 105px;">
                    <div class="layui-progress layui-progress-big" lay-showpercent="yes" lay-filter="image01">
                        <div class="layui-progress-bar" lay-percent=""></div>
                    </div>
                </div>
            </div> <a name="list-progress"> </a>
        </div>


    </div>

    <em class="explain">此处图片多用于详情页面</em>
</li>


<script>
    layui.use(['upload', 'element', 'layer'], function(){
        var $ = layui.jquery
            ,upload = layui.upload
            ,element = layui.element
            ,layer = layui.layer;

        //常规使用 - 普通图片上传
        var uploadInst = upload.render({
            elem: '#image01'
            ,url: 'https://httpbin.org/post' //此处用的是第三方的 http 请求演示，实际使用时改成您自己的上传接口即可。
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    $('#demo1').attr('src', result); //图片链接（base64）
                });

                element.progress('demo', '0%'); //进度条复位
                layer.msg('上传中', {icon: 16, time: 0});
            }
            ,done: function(res){
                //如果上传失败
                if(res.code > 0){
                    return layer.msg('上传失败');
                }
                //上传成功的一些操作
                //……
                $('#demoText').html(''); //置空上传失败的状态
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
            //进度条
            ,progress: function(n, elem, e){
                element.progress('demo', n + '%'); //可配合 layui 进度条元素使用
                if(n == 100){
                    layer.msg('上传完毕', {icon: 1});
                }
            }
        });
</script>






<!--


<li class="layui-form-item icon  icon_alt" style="display:none;">
    <label class="layui-form-label">ICON ALT：</label>
    <div class="layui-input-block"><input type="text" class="layui-input"  name="ai_icon_alt"  value="<?php echo $detail['icon_alt'];?>"></div>
    <em class="explain">(图片自定义ALT内容)</em>
</li>


<li class="layui-form-item icon">
    <label class="layui-form-label">ICON：</label>
    <div class="layui-input-block">

        <?php
        if ($detail['icon'] != 'alpha.gif' && $detail['icon'] != '') {
            ?>
            <img src="<?
            if ($detail_storage) {
                echo $detail_storage;
            } else {
                echo $site_domin;
            }
            ?>/uploadfiles/<? echo $theme_folder ?>/<? echo $detail['icon'] ?>" width="100"/>
        <?php } ?>
        <a href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=icon&sys_part=<? echo $system_part ?>">
            删除</a>
        <span class="title-data">(请上传像素<? echo $first_icon_data[0] ?>X<? echo $first_icon_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>

<li class="layui-form-item icon">
    <label class="layui-form-label">上传文件：</label>
    <div class="layui-input-block"><input type="file" name="icon" onchange="fileChange(this);"/></div>
    <em class="explain">(上传列表图标)</em></li>
<br/>






<li class="layui-form-item banner">
    <label class="layui-form-label">横幅图片：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['icon'] != 'alpha.gif' && $detail['icon'] != ''){
		?>
        <img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['banner'] ?>" width="100"/>
         <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=banner&sys_part=<? echo $system_part ?>">
            删除</a>
        <?php }?>
        
            <span class="title-data">(请上传像素<? echo $first_banner_data[0] ?>X<? echo $first_banner_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>


<li class="layui-form-item banner">
    <label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="banner" onchange="fileChange(this);"/>
    </div><em
        class="explain">(上传横幅Banner图片)</em>
</li>


<li class="layui-form-item images1">
    <label class="layui-form-label">资料图片一：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['image1'] != 'alpha.gif' && $detail['image1'] != ''){
		?>
    	<img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['image1'] ?>" width="100"/>
        <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=image1&sys_part=<? echo $system_part ?>">
            删除 </a>
        <?php }?>
         
            <span class="title-data">(请上传像素<? echo $first_image1_data[0] ?>X<? echo $first_image1_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>
<li class="layui-form-item images1"><label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="image1" onchange="fileChange(this);"/></div><em
        class="explain">(上传详细页面的图片)</em>
</li>

<li class="layui-form-item images2">
    <label class="layui-form-label">资料图片二：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['image2'] != 'alpha.gif' && $detail['image2'] != ''){
		?>
        <img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['image2'] ?>" width="100"/>
        <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=image2&sys_part=<? echo $system_part ?>">
            删除 </a>
        <?php }?>
         
            <span class="title-data">(请上传像素<? echo $first_image2_data[0] ?>X<? echo $first_image2_data[1] ?>的图片,格式为jpeg)</span>
            </div>
</li>
<li class="layui-form-item images2"><label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="image2" onchange="fileChange(this);"/></div><em
        class="explain">(上传详细页面的图片)</em>
</li>


<li class="layui-form-item images3">
    <label class="layui-form-label">资料图片三：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['image3'] != 'alpha.gif' && $detail['image3'] != ''){
		?>
    	<img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['image3'] ?>" width="100"/>
        <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=image3&sys_part=<? echo $system_part ?>">
            删除 </a>
        <?php }?>
         
            <span class="title-data">(请上传像素<? echo $first_image3_data[0] ?>X<? echo $first_image3_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>
<li class="layui-form-item images3"><label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="image3" onchange="fileChange(this);"/>
    </div>
    <em
        class="explain">(上传详细页面的图片)</em>
</li>


<li class="layui-form-item images4">
    <label class="layui-form-label">资料图片四：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['image4'] != 'alpha.gif' && $detail['image4'] != ''){
		?>
    	<img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['image4'] ?>" width="100"/>
        <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=image4&sys_part=<? echo $system_part ?>">
            删除 </a>
        <?php }?>
         
            <span class="title-data">(请上传像素<? echo $first_image4_data[0] ?>X<? echo $first_image4_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>
<li class="layui-form-item images4"><label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="image4" onchange="fileChange(this);"/>
    </div><em
        class="explain">(上传详细页面的图片)</em>
</li>


<li class="layui-form-item images5">
    <label class="layui-form-label">资料图片五：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['image5'] != 'alpha.gif' && $detail['image5'] != ''){
		?>
    	<img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['image5'] ?>" width="100"/>
        <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=image5&sys_part=<? echo $system_part ?>">
            删除 </a>
            
        <?php }?>
         
            <span class="title-data">(请上传像素<? echo $first_image5_data[0] ?>X<? echo $first_image5_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>
<li class="layui-form-item images5"><label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="image5" onchange="fileChange(this);"/>
    </div><em
        class="explain">(上传详细页面的图片)</em>
</li>


<li class="layui-form-item images6"  style="display:none">
    <label class="layui-form-label">资料图片六：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['image6'] != 'alpha.gif' && $detail['image6'] != ''){
		?>
        <img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['image6'] ?>" width="100"/>
        <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=image6&sys_part=<? echo $system_part ?>">
            删除 </a>
        <?php }?>
         
            
            <span class="title-data">(请上传像素<? echo $first_image6_data[0] ?>X<? echo $first_image6_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>

<li class="layui-form-item images6" style="display:none"><label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="image6" onchange="fileChange(this);"/>
    </div><em
        class="explain">(上传详细页面的图片)</em>
</li>

<li class="layui-form-item images7"  style="display:none">
    <label class="layui-form-label">资料图片七：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['image7'] != 'alpha.gif' && $detail['image7'] != ''){
		?>
    	<img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['image7'] ?>" width="100"/>
        <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=image7&sys_part=<? echo $system_part ?>">
            删除 </a>
        <?php }?>
         
            <span class="title-data">(请上传像素<? echo $first_image7_data[0] ?>X<? echo $first_image7_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>
<li class="layui-form-item images7" style="display:none"><label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="image7" onchange="fileChange(this);"/>
    </div><em
        class="explain">(上传详细页面的图片)</em>
</li>


<li class="layui-form-item images8" style="display:none">
    <label class="layui-form-label">资料图片八：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['image8'] != 'alpha.gif' && $detail['image8'] != ''){
		?>
    	<img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['image8'] ?>" width="100"/>
        <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=image8&sys_part=<? echo $system_part ?>">
            删除 </a>
        <?php }?>
        
            <span class="title-data">(请上传像素<? echo $first_image8_data[0] ?>X<? echo $first_image8_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>
<li class="layui-form-item images8" style="display:none"><label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="image8" onchange="fileChange(this);"/>
    </div><em
        class="explain">(上传详细页面的图片)</em>
</li>


<li class="layui-form-item images9" style="display:none">
    <label class="layui-form-label">资料图片九：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['image9'] != 'alpha.gif' && $detail['image9'] != ''){
		?>
        <img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['image9'] ?>" width="100"/>
        
        <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=image9&sys_part=<? echo $system_part ?>">
            删除 </a>
        <?php }?>
         
            <span class="title-data">(请上传像素<? echo $first_image9_data[0] ?>X<? echo $first_image9_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>


<li class="layui-form-item images9" style="display:none"><label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="image9" onchange="fileChange(this);"/>
    </div><em
        class="explain">(上传详细页面的图片)</em>
</li>

<li class="layui-form-item images10" style="display:none">
    <label class="layui-form-label">资料图片十：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['image10'] != 'alpha.gif' && $detail['image10'] != ''){
		?>
        <img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['image10'] ?>" width="100"/>
        <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=image10&sys_part=<? echo $system_part ?>">
            删除 </a>
        <?php }?>
         
            <span class="title-data">(请上传像素<? echo $first_image10_data[0] ?>X<? echo $first_image10_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>

<li class="layui-form-item images10" style="display:none"><label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="image10" onchange="fileChange(this);"/>
    </div><em
        class="explain">(上传详细页面的图片)</em>
</li>




<li class="layui-form-item extend_img">
    <label class="layui-form-label">备用图片：</label>

    <div class="layui-input-block">
    	<?php 
		if($detail['icon'] != 'alpha.gif'){
		?>
        <img src="<?
        if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        }
        ?>/uploadfiles/<? echo $theme_folder ?>/<? echo $detail['extend_img'] ?>" width="100"/> 
        <?php }?>
       <a
            href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=extend_img&sys_part=<? echo $system_part ?>">
            删除 </a><span class="title-data">(请上传像素<? echo $first_extend_img_data[0] ?>X<? echo $first_extend_img_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</li>
<li class="layui-form-item extend_img"><label class="layui-form-label">上传文件：</label>

    <div class="layui-input-block"><input type="file" name="extend_img" onchange="fileChange(this);"/>
    </div><em
        class="explain">(上传详细页面的图片)</em>
        
</li>

-->


<li class="layui-form-item attachment">
    <label class="layui-form-label">上传附件：</label>

    <div class="layui-input-block">
        <a href="<? if ($detail_storage) {
            echo $detail_storage;
        } else {
            echo $site_domin;
        } ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['attachment'] ?>">
            <? if ($detail_storage) {
                echo $detail_storage;
            } else {
                echo $site_domin;
            } ?>/uploadfiles/<? echo $theme_folder ?>/<? echo  $detail['attachment'] ?>
        </a>
		
        <a href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=attachment&sys_part=<? echo $system_part ?>">(
            删除 )</a>
    </div>
</li>
<li class="layui-form-item attachment"><label class="layui-form-label">选择附件：</label>

    <div class="layui-input-block"><input type="file" name="attachment" onchange="fileChange(this);"/>
    </div><em
        class="explain">(上传可供用户下载的附件)</em>
</li>




